<script setup>
 import { Toast } from "vant";
 import { ref } from "vue"
 import { useStore } from "vuex";
 import { useCreateGroup } from "@/hooks/create-group-hook"

 const store = useStore();
 const user = store.state.user;
 const group_name = ref("");

 const createGroup = (_id) => {
       useCreateGroup(_id,group_name)
 }

</script>

<template>
  <div>
      <br>
    <van-cell-group inset>
      <van-field v-model="group_name" label="群聊名称" placeholder="请输入群聊名称" />
    </van-cell-group>

    <div style="padding:20px 15px;">
        <van-button type="primary" size="large" @click="createGroup(user.userInfo._id)">立即创建</van-button>
    </div>
  </div>
</template>

<style lang="scss" scoped></style>
